Skip to content

Revert "Replace: Use empathic over find-up"#32470

Merged
ndelangen merged 1 commit into
nextfrom
revert-31338-empathic
Sep 16, 2025
Merged

Revert "Replace: Use empathic over find-up"#32470
ndelangen merged 1 commit into
nextfrom
revert-31338-empathic

Conversation

@ndelangen

@ndelangen ndelangen commented Sep 16, 2025

Copy link
Copy Markdown
Member

Reverts #31338

I want to do a beta release without this change first.
I'll re-apply it later.

Greptile Summary

Updated On: 2025-09-16 09:48:16 UTC

This PR reverts the comprehensive replacement of the empathic package with traditional utility packages across the entire Storybook codebase. The original change (PR #31338) attempted to consolidate multiple file system utility packages (find-up, find-cache-dir, resolve-from, fd-package-json, read-pkg-up) with the single empathic package for improved performance and reduced bundle size.

The revert affects critical infrastructure throughout Storybook:

Package Manager Integration: All package manager proxies (NPM, Yarn1, Yarn2, PNPM, BUN) revert from empathic/find and empathic/package back to their original dependencies for package.json discovery and module resolution.

Framework Presets: Angular, React, Vue3, and Ember frameworks restore their original file resolution patterns using find-up for locating configuration files like tsconfig.json and package.json files.

Build System: Vite and Webpack builders revert cache directory resolution from empathic/package back to find-cache-dir, and TypeScript configuration discovery returns to using find-up.

CLI and Initialization: The create-storybook CLI, project detection, framework detection, and Vitest integration all revert to their original async file discovery patterns using find-up.

API Changes: The revert introduces several key API differences - empathic's synchronous operations become asynchronous again (requiring await keywords), parameter names change (e.g., last becomes stopAt), and some functionality like findFilesUp with glob support is removed entirely.

Testing: All corresponding test files update their mocks to match the reverted implementations, ensuring test coverage remains intact.

The changes maintain functional equivalence while reverting to the well-established, battle-tested utility packages that were previously used throughout the Storybook ecosystem.

Confidence score: 4/5

  • This revert appears safe as it's returning to a previously working state, but the large scope affects critical path resolution functionality
  • Score reflects the comprehensive nature of the changes and potential for missed async/await conversions in the large codebase
  • Pay special attention to files with complex async/sync transitions and ensure all empathic references are properly reverted

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

52 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@nx-cloud

nx-cloud Bot commented Sep 16, 2025

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 275c2c0

Command Status Duration Result
nx run-many -t check -c production --parallel=7 ✅ Succeeded 1m 22s View ↗
nx run-many -t build -c production --parallel=3 ✅ Succeeded 3m 56s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-16 10:28:14 UTC

@ndelangen ndelangen self-assigned this Sep 16, 2025
@ndelangen ndelangen added cleanup Minor cleanup style change that won't show up in release changelog ci:normal Run our default set of CI jobs (choose this for most PRs). labels Sep 16, 2025
@storybook-app-bot

Copy link
Copy Markdown

Package Benchmarks

Commit: 275c2c0, ran on 16 September 2025 at 10:32:19 UTC

The following packages have significant changes to their size or dependencies:

@storybook/builder-vite

Before After Difference
Dependency count 11 11 0
Self size 319 KB 374 KB 🚨 +55 KB 🚨
Dependency size 1.30 MB 1.30 MB 0 B
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 48 48 0
Self size 30.49 MB 30.42 MB 🎉 -79 KB 🎉
Dependency size 17.64 MB 17.64 MB 0 B
Bundle Size Analyzer Link Link

@storybook/html-vite

Before After Difference
Dependency count 14 14 0
Self size 23 KB 23 KB 🚨 +18 B 🚨
Dependency size 1.66 MB 1.71 MB 🚨 +55 KB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs-vite

Before After Difference
Dependency count 124 130 🚨 +6 🚨
Self size 4.00 MB 4.00 MB 0 B
Dependency size 21.56 MB 21.66 MB 🚨 +94 KB 🚨
Bundle Size Analyzer Link Link

@storybook/preact-vite

Before After Difference
Dependency count 14 14 0
Self size 14 KB 14 KB 0 B
Dependency size 1.64 MB 1.70 MB 🚨 +55 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 157 163 🚨 +6 🚨
Self size 31 KB 31 KB 0 B
Dependency size 22.95 MB 23.05 MB 🚨 +94 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 114 120 🚨 +6 🚨
Self size 36 KB 36 KB 🚨 +25 B 🚨
Dependency size 19.51 MB 19.60 MB 🚨 +94 KB 🚨
Bundle Size Analyzer Link Link

@storybook/svelte-vite

Before After Difference
Dependency count 22 22 0
Self size 59 KB 59 KB 0 B
Dependency size 26.89 MB 26.95 MB 🚨 +55 KB 🚨
Bundle Size Analyzer Link Link

@storybook/sveltekit

Before After Difference
Dependency count 23 23 0
Self size 49 KB 49 KB 0 B
Dependency size 26.95 MB 27.01 MB 🚨 +55 KB 🚨
Bundle Size Analyzer Link Link

@storybook/vue3-vite

Before After Difference
Dependency count 109 110 🚨 +1 🚨
Self size 38 KB 38 KB 🚨 +77 B 🚨
Dependency size 43.76 MB 43.82 MB 🚨 +64 KB 🚨
Bundle Size Analyzer Link Link

@storybook/web-components-vite

Before After Difference
Dependency count 15 15 0
Self size 20 KB 20 KB 0 B
Dependency size 1.68 MB 1.74 MB 🚨 +55 KB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 205 205 0
Self size 883 KB 886 KB 🚨 +3 KB 🚨
Dependency size 81.79 MB 81.71 MB 🎉 -72 KB 🎉
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 174 174 0
Self size 35 KB 35 KB 0 B
Dependency size 76.86 MB 76.78 MB 🎉 -76 KB 🎉
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 49 49 0
Self size 1.52 MB 1.52 MB 🚨 +5 KB 🚨
Dependency size 48.13 MB 48.06 MB 🎉 -79 KB 🎉
Bundle Size Analyzer node node

@storybook/preset-react-webpack

Before After Difference
Dependency count 170 170 0
Self size 21 KB 26 KB 🚨 +6 KB 🚨
Dependency size 30.84 MB 30.84 MB 🚨 +3 KB 🚨
Bundle Size Analyzer Link Link

@ndelangen ndelangen merged commit 8eff750 into next Sep 16, 2025
62 of 65 checks passed
@ndelangen ndelangen deleted the revert-31338-empathic branch September 16, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal Run our default set of CI jobs (choose this for most PRs). cleanup Minor cleanup style change that won't show up in release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant